package com.lumlord.common.log;

import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.filter.Filter;
import ch.qos.logback.core.spi.FilterReply;

public class ElkFilter extends Filter<ILoggingEvent> {
	
	public static final String SIGN_INDEX="$lumlord_sign_index";
	
	@Override
	public FilterReply decide(ILoggingEvent event) {
		if (event.getMessage().indexOf(SIGN_INDEX)!=-1) {// 只有以"KeyWords"开头的日志被输出到logstash
			return FilterReply.ACCEPT;
		} else {
			return FilterReply.DENY;
		}
	}

}
